#include "previewform.h"

PreviewForm::PreviewForm(QWidget *parent)
    : QWidget(parent)
{
	ui.setupUi(this);
	connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(Print()));
	scene = new QGraphicsScene;
}

PreviewForm::~PreviewForm()
{
	delete scene;
}

void PreviewForm::Print()
{		
	QPrinter printer(QPrinter::PrinterResolution);
	printer.setPageSize(QPrinter::A4);
	QPrintDialog printDialog(&printer, this);
	
	if(printDialog.exec() == QDialog::Accepted)
	{
		ui.textEdit->print(&printer); 	
	}
}